# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-idalink
pkgname=('python2-idalink' 'python-idalink')
_pkgname=idalink
pkgver=0.12
pkgrel=10
pkgdesc='An interface to the insides of IDA.'
arch=('any')
url='https://pypi.org/project/idalink/#files'
license=('GPL3')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('2b65e7563100c1adbd21642a35ea53f8630075aa025f2fc7999c636922d12ee1def0761eb269f97dc1ac747deb8bc8b186ba2c067d4c613dcbc83287dafa478b')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-idalink() {
  depends=('python2' 'python2-rpyc')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

package_python-idalink() {
  depends=('python' 'python-rpyc')

  cd "$_pkgname-$pkgver"

  python setup.py install --prefix=/usr --root="$pkgdir" --optimize=1 \
    --skip-build
}

